<div class="container-fluid" style="padding: 20px 10px 0px 10px">
	<div class="row-fluid">
		<div class="well">
		    <ul class="nav nav-tabs">
		      <li class="active"><b>商品管理</b></li>
		    </ul>
		    <div id="myTabContent" class="tab-content">
				<div class="tab-pane active in" id="home">
					<form id="formid" action="/goods/addGoods" method="post">
						<p>商品名称：<input type="text" value="<?=$getData['goods_title']?>" placeholder="商品名称" style="width:576px" name="goods_title" type='text' class="goods_title"></p>
						<p>商品SKU：<input type="text" value="<?=$getData['goods_skuid']?>" placeholder="商品SkuId" style="width:576px" name="goods_skuid" type='text' class="goods_skuid"></p>
						<p style="display:inline">商品价格：<input type="text" value="<?=$getData['goods_price']?>" placeholder="商品价格" style="width:52px" name="goods_price" type='text' class="goods_price"> 元 
						 / &nbsp;<input type="text" value="<?=$getData['goods_attr']?>" placeholder="件/个等" style="width:28px" name="goods_attr" type='text' class="goods_attr">&nbsp;&nbsp;
						库存：<input type="text" style="width: 32px;" value="{{$getData.kcun}}" placeholder="库存" name="kcun" class="kcun" />
						&nbsp;品牌名称：<input type="text" style="width: 62px" value="{{$getData.brand}}" placeholder="品牌名称" name="brand" class="brand" />
						&nbsp;税况：<select name="taxes" style="width: 144px">
								<option value="1" <if condition="$getData['taxes'] eq 1">selected</if> >保税仓（完税）</option>
								<option value="2" <if condition="$getData['taxes'] eq 2">selected</if> >保税仓（未完税）</option>
								<option value="3" <if condition="$getData['taxes'] eq 3">selected</if> >大贸（完税）</option>
								<option value="4" <if condition="$getData['taxes'] eq 4">selected</if> >海外直邮（完税）</option>
								<option value="5" <if condition="$getData['taxes'] eq 5">selected</if> >海外直邮（未完税）</option>
								<option value="6" <if condition="$getData['taxes'] eq 6">selected</if> >跨境（未完税）</option>
								<option value="7" <if condition="$getData['taxes'] eq 7">selected</if> >跨境（完税）</option>
							</select>
						</p>

						<p><div id="setImd" tyimg="square" style="display:inline">商品图片：<input type="text" placeholder="商品图片，必须为正方形，即长宽相等的图片" name="goods_pic" class="setImdText" style="width:422px" value="<?=$getData['goods_pic']?>" readonly> <input type="button" class="btn btn-info setImdBtn" style='margin-top:-8px' value="选择图片">&nbsp;<a class="btn btn-warning  picViews" <?=$getData['goods_pic'] ? '' : 'disabled title="暂不可用"'?> url="<?=$getData['goods_pic'] ? transUrl($getData['goods_pic']) : ''?>" style='margin-top:-8px'>查看</a></div></p>
						<p><div id="setImd1" style="display:inline">商品图二：<input type="text" placeholder="商品图片" name="goods_pic2" class="setImd1Text" style="width:422px" value="<?=$getData['goods_pic2']?>" readonly> <input type="button" class="btn btn-info setImd1Btn" style='margin-top:-8px' value="选择图片">&nbsp;<a class="btn btn-warning  picViews" <?=$getData['goods_pic2'] ? '' : 'disabled title="暂不可用"'?> url="<?=$getData['goods_pic2'] ? transUrl($getData['goods_pic2']) : ''?>" style='margin-top:-8px'>查看</a></div></p>
						<p><div id="setImd2" style="display:inline">商品图三：<input type="text" placeholder="商品图片" name="goods_pic3" class="setImd2Text" style="width:422px" value="<?=$getData['goods_pic3']?>" readonly> <input type="button" class="btn btn-info setImd2Btn" style='margin-top:-8px' value="选择图片">&nbsp;<a class="btn btn-warning  picViews" <?=$getData['goods_pic3'] ? '' : 'disabled title="暂不可用"'?> url="<?=$getData['goods_pic3'] ? transUrl($getData['goods_pic3']) : ''?>" style='margin-top:-8px'>查看</a></div></p>

						<p><textarea style="width:613px;height:220px;margin-left:73px;margin-top:-20px" name="content"><?=htmlspecialchars_decode($getData['goods_content'])?></textarea></p>
						<input type="hidden" value="<?=$getData['id']?>" name="goods_id" />
						<input type="hidden" value="1" name="dosubmit" />
					</form>
				</div>
				<div class="btn-toolbar">
				    <button class="btn btn-primary" id="btn-save" style="margin:18px 0 0 70px"><i class="icon-save"></i> 保存入库</button>
				  <div class="btn-group">	
				  </div>
				</div>
			</div>
		</div>
	</div>
</div>
<script>
$(function(){
	$('#btn-save').click(function(){
		if(!($('.goods_title').val())){
			showmsg('商品名称不能为空');
			return false;
		}else if(!($('.goods_price').val())){
			showmsg('商品价格不能为空');
			return false;
		}else if(!($('.goods_skuid').val())){
			showmsg('商品SKUID不能为空');
			return false;
		}else if(!($('.goods_attr').val())){
			showmsg('产品规格不能为空');
			return false;
		}else if(!$('.kcun').val()) {
			showmsg('库存不能为空');
			return false;
		}
		//else if(!$('input[name="goods_pic"]').val()) {
			//showmsg('商品主图不能为空');
			//return false;
		//}
		else{
			setBtn($('#btn-save'));
			$('#formid').submit();
		}
	});
	$('.setImdBtn').click(function(){
		$('#setImd').selfups();
	});
	$('.setImd1Btn').click(function(){
		$('#setImd1').selfups();
	});
	$('.setImd2Btn').click(function(){
		$('#setImd2').selfups();
	});
})
</script>